# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataproc.V1.Model.WorkflowMetadata do
  @moduledoc """
  A Dataproc workflow template resource.

  ## Attributes

  *   `clusterName` (*type:* `String.t`, *default:* `nil`) - Output only. The name of the target cluster.
  *   `clusterUuid` (*type:* `String.t`, *default:* `nil`) - Output only. The UUID of target cluster.
  *   `createCluster` (*type:* `GoogleApi.Dataproc.V1.Model.ClusterOperation.t`, *default:* `nil`) - Output only. The create cluster operation metadata.
  *   `dagEndTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. DAG end time, only set for workflows with dag_timeout when DAG ends.
  *   `dagStartTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. DAG start time, only set for workflows with dag_timeout when DAG begins.
  *   `dagTimeout` (*type:* `String.t`, *default:* `nil`) - Output only. The timeout duration for the DAG of jobs, expressed in seconds (see JSON representation of duration (https://developers.google.com/protocol-buffers/docs/proto3#json)).
  *   `deleteCluster` (*type:* `GoogleApi.Dataproc.V1.Model.ClusterOperation.t`, *default:* `nil`) - Output only. The delete cluster operation metadata.
  *   `endTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Workflow end time.
  *   `graph` (*type:* `GoogleApi.Dataproc.V1.Model.WorkflowGraph.t`, *default:* `nil`) - Output only. The workflow graph.
  *   `parameters` (*type:* `map()`, *default:* `nil`) - Map from parameter names to values that were used for those parameters.
  *   `startTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Workflow start time.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. The workflow state.
  *   `template` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the workflow template as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}
  *   `version` (*type:* `integer()`, *default:* `nil`) - Output only. The version of template at the time of workflow instantiation.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :clusterName => String.t() | nil,
          :clusterUuid => String.t() | nil,
          :createCluster => GoogleApi.Dataproc.V1.Model.ClusterOperation.t() | nil,
          :dagEndTime => DateTime.t() | nil,
          :dagStartTime => DateTime.t() | nil,
          :dagTimeout => String.t() | nil,
          :deleteCluster => GoogleApi.Dataproc.V1.Model.ClusterOperation.t() | nil,
          :endTime => DateTime.t() | nil,
          :graph => GoogleApi.Dataproc.V1.Model.WorkflowGraph.t() | nil,
          :parameters => map() | nil,
          :startTime => DateTime.t() | nil,
          :state => String.t() | nil,
          :template => String.t() | nil,
          :version => integer() | nil
        }

  field(:clusterName)
  field(:clusterUuid)
  field(:createCluster, as: GoogleApi.Dataproc.V1.Model.ClusterOperation)
  field(:dagEndTime, as: DateTime)
  field(:dagStartTime, as: DateTime)
  field(:dagTimeout)
  field(:deleteCluster, as: GoogleApi.Dataproc.V1.Model.ClusterOperation)
  field(:endTime, as: DateTime)
  field(:graph, as: GoogleApi.Dataproc.V1.Model.WorkflowGraph)
  field(:parameters, type: :map)
  field(:startTime, as: DateTime)
  field(:state)
  field(:template)
  field(:version)
end

defimpl Poison.Decoder, for: GoogleApi.Dataproc.V1.Model.WorkflowMetadata do
  def decode(value, options) do
    GoogleApi.Dataproc.V1.Model.WorkflowMetadata.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataproc.V1.Model.WorkflowMetadata do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
